package com.loong.game2048.Exception;


/**
 * @author lyx
 * @date 2020/5/8 21:21
 */
public enum BizExceptionCodeEnum implements BizExceptionCode {

    // 已指明的异常,在异常使用时message并不返回前端，返回前端的为throw新的异常时指定的message
    SPECIFIED("-1","系统发生异常,请稍后重试"),

    // 常用业务异常
    USER_NAME_NULL("-1","用户名不能为空，请重新输入!"),
    USER_PASSWORD_NULL("-1","密码不能为空，请重新输入!"),
    USER_PASSWORD_WRONG("-1","密码错误,请检查后重新输入!"),
    PAGE_NUM_NULL("4001","页码不能为空"),
    PAGE_SIZE_NULL("4002","页数不能为空"),
    SEARCH_NULL("4004","搜索条件不能为空,请检查后重新输入!"),
    NO_LOGIN("3001", "用户未进行登录"),
    ACCOUNT_ERROR("3002","您的账号异常"),
    FORUM_NOT_FOUND("3003","您要回复的帖子或评论已被删除"),
    NO_SUCH_FORUM("3004","您要查看的帖子不存在"),
    NO_DEL_PERMISSION("3005","您无权删除别人的帖子"),
    NO_EDIT_PERMISSION("3006","您无权编辑别人的帖子");

    private final String code;

    private final String message;


    BizExceptionCodeEnum(String code,String message){

        this.code = code;
        this.message = message;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
